The present invention relates to a method for enlargement/reduction of image data in a digital image processing system, and more particularly, to a method for enlargement/reduction of input image data according to an arbitrary enlargement and reduction rate designated by a user.
Generally, digital image processing systems, for example, a digital copier or facsimile that converts an image into an electrical signal and processes the result by employing a photoelectric device (i.e., an image sensor such as a charge-coupled device), require a function for enlarging or reducing an original size image, in other words, a rate-converting function or an enlargement/reduction function. In order to satisfy such a requirement, an enlargement/reduction function is realized in a conventional method in which a regulated copy ratio (e.g., zooming), even in lot units for standard-sized documents, is made possible.
A technique applied for the conventional enlargement and reduction operations as above is illustrated in FIG. 1. Here, the pulse rate of an input (write) clock is controlled to correspond to a zooming ratio when image data is written into an image memory, for example, a line memory for storing the image data in units of one line of the main scanning direction, by employing a sync signal of the image data, and the pulse rate of an output (read) clock is controlled to correspond to a zooming ratio when the image data is read out from the image memory. In other words, when an image is to be doubled in size, the image data input at the image sync signal rate is written into an image memory and the same image data is read out from the image memory for two image sync signal pulses, to thereby output an image whose size is twice the original. Meanwhile, when an image is to be halved in size, alternating image data is written into the image memory every two image sync signal pulses and the image is read out from the image memory at the image sync signal rate, to thereby output an image whose size is half the original. (A more detailed method is disclosed in Japanese Laid-open Publication No. sho59-39158.)
Enlargement (115% reproduction) and reduction (85% reproduction) operations performed according to the above technique are exemplified in the following Tables 1 and 2, respectively, where P is a value used in connection with zooming ratio, K is an integer value and R is the zooming ratio.
TABLE 1 ______________________________________ number of data data data number of input pixels value P + R value P value K output pixels ______________________________________ 1 1.15 0.00 1 1 2 1.30 0.15 1 2 3 1.45 0.30 1 3 4 1.60 0.45 1 4 5 1.75 0.60 1 5 6 1.90 0.75 1 6 7 2.05 0.90 2 7, 8 8 1.20 0.05 1 9 9 1.35 0.20 1 10 10 1.50 0.35 1 11 11 1.65 0.50 1 12 12 1.80 0.65 1 13 13 1.95 0.80 1 14 14 2.10 0.95 2 15, 16 15 1.25 0.10 1 17 16 1.40 0.25 1 18 17 1.55 0.40 1 19 18 1.70 0.55 1 20 19 1.85 0.70 1 21 20 2.00 0.85 2 22, 23 21 1.15 0.00 1 24 22 1.30 0.15 1 25 23 1.45 0.30 1 26 . . . . . . . . . . . . . . . ______________________________________
TABLE 2 ______________________________________ number of data data data number of input pixels value P + R value P value K output pixels ______________________________________ 1 0.85 0.00 0 2 1.70 0.85 1 1 3 1.55 0.70 1 2 4 1.40 0.55 1 3 5 1.25 0.40 1 4 6 1.10 0.25 1 5 7 0.95 0.10 0 8 1.80 0.95 1 6 9 1.65 0.80 1 7 10 1.50 0.65 1 8 11 1.35 0.50 1 9 12 1.20 0.35 1 10 13 1.05 0.20 1 11 14 0.90 0.05 0 15 1.75 0.90 1 12 16 1.60 0.75 1 13 17 1.45 0.60 1 14 18 1.30 0.45 1 15 19 1.15 0.30 1 16 20 1.00 0.15 1 17 21 0.85 0.00 0 22 1.70 0.85 1 18 23 1.55 0.70 1 19 . . . . . . . . . . . . . . . ______________________________________ In the above tables, a zooming ratio (R) is sequentially added to the number of input pixels, and the zooming ratio (R) is accumulated again with respect to the decimal value of the accumulated values, and an integer portion (K) of the accumulated values is examined. In the operation state of Table 1, the zooming ratio (R) is 1.15. Here, if the examined integer portion (K) is above two, the next pixel data value is added to the input pixel data value, to thereby perform an enlargement corresponding to the zooming ratio (R). In the operation state of table 2, the zooming ratio (R) is 0.85. Here, if the examined integer portion (K) is less than one, the pixel data is not output and the next pixel data value is output, to thereby perform an reduction corresponding to the zooming ratio (R). However, the circuit for implementing such an enlargement/reduction method is very complicated, and controlling the timing for high-speed processing is difficult. In addition, the circuit is costly and the range of the enlargement/reduction ratio cannot be easily extended or otherwise modified. Another conventional technique is disclosed in Japanese Laid-open Publication No. hei2-132963, which is shown in FIG. 2A to FIG. 2D. Referring to FIG. 2A, reference numerals 25 and 26 denote FIFO memories A and B each having a capacity of one line of the main scanning direction, for example, 4752 pixels (16 pels/mm.times.297 mm; i.e., length of A4-sized paper). As shown in FIG. 2B, a memory write operation is performed when write enable signals /AWE and /BWE are low, and a memory read operation is performed when read enable signals /ARE and /BRE are low. In addition, the output of FIFO A is at a high impedance state when its read enable signal (/ARE) is high, and the output of FIFO B is at a high impedance state when its read enable signal (/BRE) is high. Thus, the respective outputs of FIFO A and FIFO B are output in a wired-OR state (D.sub.OUT) . In FIFO memories 25 and 26, an internal pointer proceeds in accordance with a write address counter and a read address counter which are operated by write clock WCK and read clock RCK, respectively, as shown in FIG. 2C. Therefore, the input image data is reduced when, with the sync signal VCLK of the image data (Din) which is divided by a rate multiplier (RMP1) 27, is applied to the write clock port of write address memory 30 and the sync signal VCLK, which is similarly divided by a rate multiplier (RMP2) 28, is applied to the read clock port of read address memory 31. Conversely, the input image is enlarged if the applied clock signals are reversed. Thus, FIFOs A and B alternately perform read and write operations. Meanwhile, a write address counter 30 and a read address counter 31 of FIFO memories 25 and 26 are structured such that counting is performed by a clock for the section where enable signals (WE and RE) are low, and are initialized (reset) upon a logic "low" state of a reset signal RST. For example, as shown in FIG. 2D, after an RST pulse (the inverted sync signal /HSYNC of main direction scanning) is input, pixel data from pixel n1 to pixel n1+m is written during the logic "low" state of the write enable signals of FIFOs A and B (/AWE and /BWE). Then, pixel data from pixel n2 to pixel n2+m is read out during the logic "low" state of the read enable signals (/ARE and /BRE). As a result, the write data becomes the read data, as shown in FIG. 2D. The above-described method controls an output sync signal of image data at the point of reading/writing the image data from/to a line memory so as to perform enlargement or reduction which can be achieved stably in 1% units. However, the circuitry for achieving such an enlargement/reduction operation (i.e., 1% units) is quite complex. Further, in order to perform enlargement and reduction over a greater range of zooming ratios (beyond, say, 25% to 400%), the hardware needs to be physically altered. SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide a method for the enlargement/reduction image data in a digital image processing system, for promptly outputting image data of the desired reproduction or reduction rate with reference to data stored in a look-up-table (LUT) having a small capacity, whenever a user changes a zooming ratio. It is another object of the present invention to provide a circuit suitable for realizing the above method. To accomplish the above first object, there is provided an image data enlargement/reduction method in a digital image processing system which comprises an LUT where a small quantity of data for use in enlargement/reduction is stored and a memory for use in enlargement/reduction, and which enlarges/reduces input image data in accordance with a user-designated zooming ratio, the method comprising the steps of: (a) dividing the user-designated zooming ratio by one and calculating the quotient and remainder thereof; (b) reducing image data with reference to the data stored in the LUT, if the quotient calculated in the step (a) is less than one; (c) enlarging image data with reference to the data stored in the LUT, if the quotient calculated in the step (a) is greater than one and the remainder thereof is not zero; (d) performing a simple enlargement process, if the quotient calculated in the step (a) is greater than one and the remainder thereof is zero; and (e) writing the enlargement/reduction data calculated via the steps (a) to (d) into the memory. To accomplish the above second object, there is provided an enlargement/reduction circuit for enlarging and reducing image data input to a digital image processing system and outputting an image corresponding to a user-designated zooming ratio, the circuit comprising: a first memory for storing an LUT for use in enlargement/reduction; a microprocessor for calculating enlargement/reduction data corresponding to the zooming ratio, using the LUT stored in the first memory; a second memory for temporarily storing, in the course of calculating the enlargement/reduction data by the microprocessor, the enlargement/reductio n data of the LUT and enlargement/reduction data for an amount of one line calculated from the microprocessor; first and second line memories for storing the input image data to be enlarged/reduced, in units of one scanned line, respectively; a third memory for performing enlargement/reduction by employing the enlargement/reduction data stored in the second memory; a first counter for counting a sync signal of the image data in order to write the one scanned line units of the image data, into predetermined addresses of the first and second line memories; a second counter for counting the sync signal of the image data in order to output the data of the third memory as addresses of the first and second line memories, so that data can be written into the third memory by the microprocessor and so that enlargement/reduction can be performed with respect to the user-designated zooming ratio during a scanning operation; and a frequency divider for frequency-dividing a line sync signal such that the read and write operations of the first and second line memories can be performed alternately.